package com.hjc.service;

import com.hjc.dao.Impl.UserDaoImpl;
import com.hjc.dao.UserDaoFactory;
import com.hjc.dao.user.UserDao;
import com.hjc.entity.User;

/**
 * 用户业务类，实现对User的业务管理
 */
public class UserServiceImpl  implements  UserService{
    //实例化所依赖的UserDao对象
//    private UserDao dao = new UserDaoImpl();
    private UserDao dao = UserDaoFactory.getInstance();
    public void addNewUser(User user) {
        //调用UserDao的方法保存用户信息
        dao.save(user);
    }
}
